/*******************************************************************************
* Copyright (c) 2010, 2017 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qinyeit.serviceapp.entity.enums.PrintSettingOrderType;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: PrintSettingOrderData <br/>
 * Function: 单据打印设置动态数据 <br/>
 * date: 2018-07-05 11:50:43 <br/>
 *
 * @author 马飞月
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="print_setting_order_datas")
public class PrintSettingOrderData extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 所属单据打印设置
	@ManyToOne
	@JoinColumn(name="print_setting_order_id")
	@JsonIgnore
	private PrintSettingOrder printSettingOrder = null;

	// 打印类型 (总部订单/总部入库/总部出库/总部调拨/总部盘点/...)
    @Column(name="print_type")
	@Enumerated(EnumType.STRING)
	private PrintSettingOrderType printType;

	// 数据控制 (0-系统默认不允许调整/1-客户自定义显示列)
    @Column(name="data_controle")
	private Integer dataControle = 0;

	// 数据列名称 (如：客户名称)
    @Column(name="name", length = 100)
	private String name = "";

	// 数据列约定键 (如：clientname)
    @Column(name="code", length = 100)
	private String code = "";

	// 是否打印 (true-打印/false-不打印)
    @Column(name="is_print")
	private Boolean hasPrint = false;

	// 排序权重, 支持整数与小数, 值越大越靠后
	@Column(name="weight")
	private Double weight = 0.0;
	@Tolerate
	public PrintSettingOrderData() {
		
	}
	@Tolerate
	public PrintSettingOrderData(Long id){
		super.setId(id);
	}

    public PrintSettingOrder getPrintSettingOrder() {
        return printSettingOrder;
    }

    public void setPrintSettingOrder(PrintSettingOrder printSettingOrder) {
        this.printSettingOrder = printSettingOrder;
    }

    public PrintSettingOrderType getPrintType() {
        return printType;
    }

    public void setPrintType(PrintSettingOrderType printType) {
        this.printType = printType;
    }

	public Boolean getHasPrint() {
		return hasPrint;
	}

	public void setHasPrint(Boolean hasPrint) {
		this.hasPrint = hasPrint;
	}

	/**
	 * 获取数据控制
	 */
	public Integer getDataControle() {
		return this.dataControle;
	}

	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	/**
     * 设置数据控制
     */
	public PrintSettingOrderData setDataControle(Integer dataControle) {
		this.dataControle = dataControle;
		return this;
	}

	/**
	 * 获取数据列名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置数据列名称
     */
	public PrintSettingOrderData setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取数据列约定键
	 */
	public String getCode() {
		return this.code;
	}

    /**
     * 设置数据列约定键
     */
	public PrintSettingOrderData setCode(String code) {
		this.code = code;
		return this;
	}



}
